﻿using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HynuIOTA.IService;
using HynuIOTA.Service;

namespace HynuIOTA.Service
{
    public partial class ServiceSession : IService.IServiceSession
    {
        public int SaveChanges()
        {
            return DBSessionFactory.GetDBSession().SaveChanges();
        }

        public Task<int> SaveChangesAsync()
        {
            return DBSessionFactory.GetDBSession().SaveChangesAsync();
        }

        public int ExecuteSqlCommand(string sqlCommand)
        {
            return DBSessionFactory.GetDBSession().ExecuteSqlCommand(sqlCommand);
        }

        public Task<int> ExecuteSqlCommandAync(string sqlCommand)
        {
            return DBSessionFactory.GetDBSession().ExecuteSqlCommandAync(sqlCommand);
        }

        public DbRawSqlQuery<T> SqlQuery<T>(string sqlQuery)
        {
            return DBSessionFactory.GetDBSession().SqlQuery<T>(sqlQuery);
        }
    }
}
